home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Prefs
/
MPP.h
< prev
next >
Wrap
C/C++ Source or Header
|
1999-02-07
|
12KB
|
338 lines
#include "/ModePro.h"
#define CATCOMP_NUMBERS
#include "MPPLocale.h"
#include <devices/inputevent.h>
#define LIST_AREA 0
#define PROM_AREA 1
#define OPT_AREA 2
#define TD_AREA 3
#define FONT_AREA 4
#define SHPN_AREA 5
#define PUB_AREA 6
#define HOTK_AREA 7
#define BACKDROP_AREA 8
#define PGAD_AREA 9
#define TOTAL_AREAS 10
extern struct IBox GadgetArea[];
#define MAX_TYPE 3
#define MAX_MODE 3
#define MAX_CENTERFLAG 3
#define MAX_FONT 3
#define MPP_IDCMP (IDCMP_REFRESHWINDOW | IDCMP_MENUPICK | INTEGERIDCMP | BUTTONIDCMP | CYCLEIDCMP | LISTVIEWIDCMP | IDCMP_VANILLAKEY | IDCMP_RAWKEY)
#define MPP_SLEEP_IDCMP (IDCMP_REFRESHWINDOW)
#define ITEM_NEW_NAME 0
#define ITEM_NO_NAME 1
#define OK 2
#define LOAD_MP_PREFS 3
#define SAVE_MP_PREFS 4
#define LOAD_ERROR 5
#define SAVE_ERROR 6
#define SELECT_SCREEN_FONT 7
#define SELECT_DEF_FOR 8
#define UNKNOWN_PROMOTION_MODE 9
#define MT_MILLION 10
/** Misc Nodes **/
struct PenNode
{
struct Node Pen_Node;
UWORD PenNumber;
ULONG Value;
};
struct ModeNode
{
struct Node mn_Node;
ULONG mn_DisplayID;
};
/* Menu IDs */
/* Project Menu */
#define M_OPEN FULLMENUNUM(0,0,NOSUB)
#define M_SAVE FULLMENUNUM(0,1,NOSUB)
#define M_SAVEAS FULLMENUNUM(0,1,NOSUB)
/* Bar */
#define M_IMPORT FULLMENUNUM(0,3,NOSUB)
/* Bar */
#define M_ABOUT FULLMENUNUM(0,5,NOSUB)
/* Bar */
#define M_HIDE FULLMENUNUM(0,7,NOSUB)
#define M_QUIT FULLMENUNUM(0,8,NOSUB)
/* Edit Menu */
#define M_LASTSAVED FULLMENUNUM(1,0,NOSUB)
#define M_RESTORE FULLMENUNUM(1,1,NOSUB)
/* Bar */
#define M_COPY_TO FULLMENUNUM(1,3,NOSUB)
#define M_COPY_TO_SCR FULLMENUNUM(1,3,0)
#define M_COPY_TO_PRG FULLMENUNUM(1,3,1)
#define M_COPY_TO_SMODE FULLMENUNUM(1,3,2)
#define M_COPY_TO_PUB FULLMENUNUM(1,3,3)
/* Bar */
#define M_SORT FULLMENUNUM(1,5,NOSUB)
/* Settings Menu */
#define M_ENABLED FULLMENUNUM(2,0,NOSUB)
#define M_ENABLENL FULLMENUNUM(2,1,NOSUB)
/* BAR */
#define M_SET_UNKNOWN FULLMENUNUM(2,3,NOSUB)
#define M_SET_UNKNOWN_PUB FULLMENUNUM(2,4,NOSUB)
#define M_SET_CENTER FULLMENUNUM(2,5,NOSUB)
#define M_SET_CENTER_H FULLMENUNUM(2,5,0)
#define M_SET_CENTER_V FULLMENUNUM(2,5,1)
/*** GADGETS ***/
#define GetGadString( g ) ((( struct StringInfo * )g->SpecialInfo )->Buffer )
#define GetGadNumber( g ) ((( struct StringInfo * )g->SpecialInfo )->LongInt )
#define GD_TYPE 0
#define GD_NEW 1
#define GD_LIST 2
#define GD_NAME 3
#define GD_REMOVE 4
#define GD_LOOK3D 5
#define GD_MODESEL 6
#define GD_SELMODE 7
#define GD_AUTOSCROLL 8
#define GD_SCREENMODE 9
#define GD_WIDTH 10
#define GD_HEIGHT 11
#define GD_OVERSCAN 12
#define GD_MOVE 13
#define GD_RESETPENS 14
#define GD_PENLIST 15
#define GD_PENVAL 16
#define GD_INTERLEAVE 17
#define GD_PICKFONT 18
#define GD_CENTER 19
#define GD_SFONT 20
#define GD_FASPECT 21
#define GD_DODEPTH 22
#define GD_DEPTH 23
#define GD_SHAREPENS 24
#define GD_LOCKEDPENS 25
#define GD_PUBOPT 26
#define GD_PUBNAME 27
#define GD_HOTKEYOPT 28
#define GD_HOTKEYSTR 29
#define GD_SAVE 30
#define GD_USE 31
#define GD_CANCEL 32
#define GD_SELECT_NAME 33
#define GD_PALETTE 34
#define GD_EDITPALETTE 35
#define GD_FORCE_PLANAR 36
#define GD_BLANK_BORDER 37
#define GD_BEHIND 38
#define GD_3D_DEFAULT 39
#define GD_FE_SAVEUSE 40
#define GD_FE_USEDELETE 41
#define GD_FE_NEVER 42
#define GD_FE_CANCEL 43
#define GD_FE_ENTRY_NAME 44
#define GD_FE_ENTRY_TYPE 45
#define GD_BACKDROPOPT 46
#define GD_BACKDROPFILENAME 47
#define GD_BACKDROPPICK 48
#define GD_BACKDROPCENTER 49
#define GD_BACKDROPCOLOR 50
#define GD_DOOVERSCAN 51
#define GD_DODIMENSIONS 52
#define GD_FE_SCREENNAME 53
#define GD_FE_SCREENNAME_DISP 54
#define GD_FE_PROGRAMNAME 55
#define GD_FE_PROGRAMNAME_DISP 56
#define GD_FE_SCREENMODE 57
#define GD_FE_SCREENMODE_DISP 58
#define GD_FE_PUBLICSCREEN 59
#define GADGETS 60
struct TextArea
{
WORD LeftEdge, TopEdge,
RightEdge, BottomEdge,
Width, Height,
Baseline;
LONG PrevWidth;
};
struct LetterGad
{
STRPTR String;
ULONG GadID;
};
struct LG_RetVal
{
UWORD GadID;
UWORD Char;
};
/*** PROTOTYPES ***/
BOOL GetArgs(int argc, char **argv);
void CleanupArgs(void);
void ProcessPrefsMessages(void);
/**** DefaultNode Funcs ****/
struct DefaultNode *GetActiveNode(void);
LONG CountNodes(struct List *List);
BOOL SelectName(struct DefaultNode *DN);
/**** Interface ()'s ****/
STRPTR GetString( LONG stringNum);
void InitStrings(void);
BOOL ShowGUI(void);
void HideGUI(void);
void UpdateGadgets(void);
void SetDispGadgets(struct DefaultNode *n);
void SetFontGadgets(struct DefaultNode *n);
void SetSharedGadgets(struct DefaultNode *n);
void SetDepthGadgets(struct DefaultNode *n);
void SetPublicGadgets(struct DefaultNode *n);
void SetHotKeyGadgets(struct DefaultNode *n);
void SetOptionGadgets(struct DefaultNode *n);
void Set3DGadgets(struct DefaultNode *n);
void SetPaletteGadgets(struct DefaultNode *n);
void SetBackdropGadgets(struct DefaultNode *n );
void Process_Keys(struct IntuiMessage *IMsg);
void process_gadgetups(struct IntuiMessage *imsg);
void process_mousemoves(struct IntuiMessage *imsg);
void process_menus(struct IntuiMessage *imsg);
void ProcessInput(void);
void SetupPenNodes(void);
void SetPenValues(WORD *pens);
ULONG __saveds __asm ExcludeHook(register __a0 struct Hook *hook,
register __a1 ULONG *Msg,
register __a2 struct SGWork *SW);
void FindMaxPenNameSize(struct TextAttr *TA);
ULONG __saveds __asm PensLVFunc(register __a0 struct Hook *Hook,
register __a1 struct LVDrawMsg *Dm,
register __a2 struct PenNode *PN);
ULONG __saveds __asm PromotionLVFunc(register __a0 struct Hook *Hook,
register __a1 struct LVDrawMsg *Dm,
register __a2 struct DefaultNode *DN);
// mppgadgets.c
void WriteColorDisp(struct DefaultNode *);
void WritePenNameDisp(STRPTR Name);
void WriteFontDisp(struct DefaultNode *DN);
void RefreshGUI(void);
void SetupTextArea(struct TextArea *TA);
/**** Files ****/
LONG SendDaemonMsg(ULONG Command, ULONG Code, APTR Data);
BOOL PrefLoadFile(STRPTR FileName);
BOOL PrefSaveFile(STRPTR FileName);
BOOL SaveFile(struct List *List, UBYTE *filename);
/**** Requesters ****/
BOOL SelectFile(UBYTE *title,UBYTE save);
ULONG SelectScreenMode(struct Window *Win, struct DefaultNode *n, BOOL DoOrig);
BOOL PickFont(struct Window *, struct TTextAttr *TA);
void PaletteReq(struct DefaultNode *);
STRPTR GetModeName(ULONG DisplayID);
ULONG GetMonitorName(ULONG DisplayID, STRPTR Buffer, ULONG BufferLen);
struct Screen *GetScreen(void);
void ReleaseScreen(struct Screen *S);
/**** Clean Up ()'s ****/
void CleanUp(void);
void GD_Type(LONG Code);
struct DefaultNode *GD_New(void);
void GD_Save(void);
void GD_Use(void);
void GD_Cancel(void);
void GD_List(LONG Item, BOOL Keyed,struct IntuiMessage *);
void GD_SelectName(struct DefaultNode *N);
void GD_ModeSel(struct DefaultNode *N, LONG Mode, BOOL Keyed);
void GD_SelMode(struct DefaultNode *N);
void GD_Overscan(struct DefaultNode *N, LONG Value, BOOL Keyed);
void GD_Remove(struct DefaultNode *N);
void GD_PenList(struct DefaultNode *N, LONG Item, BOOL Keyed);
void GD_ResetPens(struct DefaultNode *N);
void GD_PickFont(struct DefaultNode *N);
void GD_Interleave(struct DefaultNode *N, BOOL Set, BOOL Keyed);
void GD_Look3D(struct DefaultNode *N, BOOL Set, BOOL Keyed);
void GD_AutoScroll(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_PenVal(struct DefaultNode *N, BOOL Flag);
void GD_ResetPens(struct DefaultNode *N);
void GD_PickFont(struct DefaultNode *N);
void GD_Center(struct DefaultNode *N, LONG Num, BOOL Keyed);
void GD_FAspect(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_SFont(struct DefaultNode *N, LONG Code, BOOL Keyed);
void GD_PubOpt(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_DoDepth(struct DefaultNode *N, BOOL Set, BOOL Keyed);
void GD_SharePens(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_HotKeyOpt(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_Palette(struct DefaultNode *N, BOOL Set, BOOL Keyed);
void GD_EditPalette(struct DefaultNode *N);
void GD_Move(LONG Num, BOOL Keyed);
void GD_Depth(struct DefaultNode *N, LONG Depth, BOOL Keyed);
void GD_Force_Planar(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_Behind(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_Blank_Border(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_3D_Default(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_FE_SaveUse(void);
void GD_FE_UseDelete(void);
void GD_FE_Never(void);
void GD_FE_Cancel(void);
void GD_BackdropOpt(struct DefaultNode *N, LONG Flag, BOOL Keyed);
void GD_BackdropPick(struct DefaultNode *N);
void GD_BackdropCenter(struct DefaultNode *N, BOOL Flag, BOOL Keyed);
void GD_BackdropColor(struct DefaultNode *N, BOOL Keyed);
struct LG_RetVal MatchKey2Gad(ULONG Key, struct LetterGad *LG);
LONG SelectReq(struct List *List, STRPTR WinTitle);
struct Node *AllocNameNode(STRPTR Name);
void FreeNameNodes(struct List *List);
ULONG SelectMonitor(struct DefaultNode *DN);
ULONG __saveds __asm PenValFunc(register __a0 struct Hook *hook,
register __a1 ULONG *Msg,
register __a2 struct SGWork *SW);
ULONG __saveds __asm WinBackFillHook(register __a0 struct Hook *Hook,
register __a1 struct BFBounds *BF,
register __a2 struct RastPort *RP);
void RefreshMenus(void);
BOOL RemakeGads(void);
struct LG_Control *MakeMPPGadgets(struct Window *Window, APTR VisualInfo, struct TextAttr *TA);
void FreeMPPGadgets(void);
BOOL GadgetInit(void);
void GadgetCleanup(void);
BOOL LoadPalette(struct DefaultNode *DN);
BOOL SaveCMAP(STRPTR Filename, struct RGB *CReg, ULONG Colors);
BOOL SelectBackdropFile(UBYTE *title,struct Window *Parent,STRPTR OldFile);
void CheckMenuItem(ULONG MenuItem, BOOL Checked);
void FixScreenModeNames(void);
void ReplaceGStr(STRPTR *A, ULONG GID);
BOOL ImportFile(STRPTR FileName);